<template>
  <t-input
    style="width: 100%"
    @click="handleInputSelectClick"
    :placeholder="placeholder || '点击右边按钮选择'"
    :value
    :readonly="true"
  >
    <template #suffixIcon v-if="!disabled"><search-icon :style="{ cursor: 'pointer' }" /></template>
  </t-input>
</template>

<script setup lang="tsx">
import { SearchIcon } from "tdesign-icons-vue-next";

const props = defineProps(["value", "placeholder", "disabled"]);

const emit = defineEmits(["onClick"]);

const handleInputSelectClick = () => {
  if (props.disabled) {
    return;
  }
  emit("onClick");
};
</script>
